import 'package:flutter/material.dart';
import 'package:flutter_app/Contact/AddContact.dart';
import 'package:flutter_app/Contact/AddContact2.dart';
import 'package:flutter_app/Contact/searchContact.dart';
import 'package:flutter_app/home/main_page.dart';
import 'package:flutter_app/movie/Movie_detials.dart';
import 'package:flutter_app/movie/Popular_list.dart';
import 'package:flutter_app/person_data.dart';
import 'package:flutter_app/login.dart';
import 'package:flutter_app/register.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      initialRoute: "First",
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      routes: {
        "Register":(context)=>Register(),
        "First":(context)=>First(),
        "person_data":(context)=> person_data(),
        "Login":(context) => Login(),
        "AddContact":(context)=>AddContact(),
        "AddContact2":(context)=> add(),
      },
      home:First()
    );
  }
}
class First extends StatelessWidget{
  Widget build(BuildContext buildContext){
    return new Scaffold(
      appBar: new AppBar(
        title: Text("不知道起啥名好"),
        automaticallyImplyLeading: false,
      ),
      body:Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Center(
            child: RaisedButton(
              child: Text('登录'),
              onPressed: (){
                Navigator.pushNamed(buildContext, "Login");
              },
            ),
          ),
          Center(
            child:  RaisedButton(
              child: Text('电影'),
              onPressed: (){
                //Navigator.pushNamed(buildContext,"Register");
                Navigator.push(buildContext, MaterialPageRoute(builder: (buildContext)=>Popular_list()));
               // Navigator.pop(buildContext);
              },
            ),
          )
        ],
      )
    );
  }
}
